/**
 * 按钮样式
 */

.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: var(--border-radius);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.btn:focus, 
.btn:active {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
}

.btn:disabled, 
.btn.disabled {
    opacity: 0.65;
    pointer-events: none;
}

/* 按钮变体 */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
    border-color: var(--primary-color-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover {
    background-color: var(--secondary-color-dark);
    border-color: var(--secondary-color-dark);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: #fff;
}

.btn-success:hover {
    background-color: var(--success-color-dark);
    border-color: var(--success-color-dark);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    background-color: var(--danger-color-dark);
    border-color: var(--danger-color-dark);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: #212529;
}

.btn-warning:hover {
    background-color: var(--warning-color-dark);
    border-color: var(--warning-color-dark);
}

.btn-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
    color: #fff;
}

.btn-info:hover {
    background-color: var(--info-color-dark);
    border-color: var(--info-color-dark);
}

.btn-light {
    background-color: var(--light-color);
    border-color: var(--light-color);
    color: #212529;
}

.btn-light:hover {
    background-color: var(--light-color-dark);
    border-color: var(--light-color-dark);
}

.btn-dark {
    background-color: var(--dark-color);
    border-color: var(--dark-color);
    color: #fff;
}

.btn-dark:hover {
    background-color: var(--dark-color-light);
    border-color: var(--dark-color-light);
}

/* 轮廓按钮 */
.btn-outline-primary {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-outline-secondary {
    background-color: transparent;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    color: #fff;
}

/* 按钮尺寸 */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* 图标按钮 */
.btn-icon {
    padding: 0.5rem;
    line-height: 1;
}

.btn-icon i, 
.btn-icon svg {
    vertical-align: middle;
}

/* 块级按钮 */
.btn-block {
    display: block;
    width: 100%;
}

/* 加载状态 */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: calc(50% - 0.5rem);
    left: calc(50% - 0.5rem);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    border-top-color: var(--color-white);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 按钮组 */
.btn-group {
    display: inline-flex;
    position: relative;
}

.btn-group .btn {
    position: relative;
    flex: 1 1 auto;
}

.btn-group .btn:not(:first-child) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn-group .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* 按钮波纹效果 */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.btn-ripple:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

.btn-full {
    width: 100%;
}

.btn:disabled:before,
.btn.disabled:before {
    display: none;
} 